Skip to content

docs: add attachment params to POST /api/content/create#91

Merged
sweetmantech merged 2 commits intomainfrom
feat/content-create-attachment-params
Mar 31, 2026
Merged

docs: add attachment params to POST /api/content/create#91
sweetmantech merged 2 commits intomainfrom
feat/content-create-attachment-params

Conversation

@sweetmantech
Copy link
Copy Markdown
Collaborator

@sweetmantech sweetmantech commented Mar 31, 2026

Summary

  • Add attached_audio_url and attached_image_url optional parameters to the ContentCreateRequest schema in openapi.json
  • Update endpoint description to note that attached media can override default face guide and songs

Context

Companion to recoupable/api#381 and recoupable/tasks#116, which add support for extracting Slack message attachments and using them in the content creation pipeline.

Test plan

  • Preview docs locally with npx mintlify@latest dev and verify the new params appear on the content/create page

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated /api/content/create endpoint documentation to reflect conditional file validation when attached media is provided.
  • New Features

    • Added optional parameter to upload custom audio for processing.
    • Added optional parameter to upload custom face guide image.

Document the new optional attachment parameters for POST /api/content/create.
These allow callers to provide custom audio and face-guide images that override
the defaults from the artist's GitHub repo.

Companion to recoupable/api#381 and recoupable/tasks#116.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 24 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71363651-730a-4d0e-84df-802197b090e5

📥 Commits

Reviewing files that changed from the base of the PR and between 0fddf77 and 4274502.

📒 Files selected for processing (2)
  • api-reference/openapi.json
  • docs.json
📝 Walkthrough

Walkthrough

This change extends the OpenAPI schema for the content creation endpoint by introducing two optional URI parameters (attached_audio_url and attached_image_url) that enable conditional overrides of default validation requirements. The endpoint documentation is also updated to reflect this conditional validation behavior.

Changes

Cohort / File(s) Summary
OpenAPI Schema Extension
api-reference/openapi.json
Added attached_audio_url and attached_image_url optional URI fields to ContentCreateRequest schema. Updated /api/content/create POST endpoint description to clarify that face guide and songs validation are conditional when attached media is provided.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 A clever rabbit once said with glee,
"Attach your audio, attach with ease!
Override defaults with media so bright,
The API now bends to your delight!"

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add attachment params to POST /api/content/create' directly and clearly summarizes the main change: adding two new optional attachment parameters to the API endpoint documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/content-create-attachment-params

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

"attached_audio_url": {
"type": "string",
"format": "uri",
"description": "Public URL of an audio file to use instead of selecting from the artist's Git repo songs. When provided, the pipeline downloads this audio, transcribes it, and selects a clip from it. Overrides the `songs` parameter.",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we consider expanding the songs param to allow http override instead of adding a attached_audio_url param?

"description": "Public URL of an audio file to use instead of selecting from the artist's Git repo songs. When provided, the pipeline downloads this audio, transcribes it, and selects a clip from it. Overrides the `songs` parameter.",
"example": "https://example.com/my-song.mp3"
},
"attached_image_url": {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KISS principle

  • actual: attached_image_url
  • required: images. array to match songs array.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
api-reference/openapi.json (1)

10742-10752: Document concrete constraints for attached media URLs.

These new fields are great, but the contract is still underspecified (accepted formats, max file size/duration, and URL accessibility requirements). Adding those details will reduce integration errors and support churn.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 10742 - 10752, Update the OpenAPI
schema entries for attached_audio_url and attached_image_url to include concrete
constraints: specify allowed file formats (e.g., audio: mp3, wav, m4a; image:
png, jpg, jpeg, webp) in the description, add max file size (e.g., "max 50MB")
and for audio include max duration (e.g., "max 5 minutes"), declare that URLs
must be publicly accessible via HTTPS and return 200 on GET (no auth/redirects),
add a pattern or format hint if desired (e.g., must be https://) and update the
examples/descriptions to reflect these limits so integrators know accepted
formats, size/duration caps, and accessibility requirements for
attached_audio_url and attached_image_url.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api-reference/openapi.json`:
- Line 3788: Update the /api/content/validate operation description to clarify
that required-file checks (face guide, songs, etc.) are conditional: if request
includes attached_audio_url or attached_image_url those override the need for
stored artist files and will cause the endpoint to succeed where it otherwise
would fail; reference the artist_account_id parameter and describe that the
endpoint validates presence of either the artist's stored assets or the provided
attached_* URLs, and returns validation details (errors/warnings) accordingly so
clients don't reject requests that include override media.

---

Nitpick comments:
In `@api-reference/openapi.json`:
- Around line 10742-10752: Update the OpenAPI schema entries for
attached_audio_url and attached_image_url to include concrete constraints:
specify allowed file formats (e.g., audio: mp3, wav, m4a; image: png, jpg, jpeg,
webp) in the description, add max file size (e.g., "max 50MB") and for audio
include max duration (e.g., "max 5 minutes"), declare that URLs must be publicly
accessible via HTTPS and return 200 on GET (no auth/redirects), add a pattern or
format hint if desired (e.g., must be https://) and update the
examples/descriptions to reflect these limits so integrators know accepted
formats, size/duration caps, and accessibility requirements for
attached_audio_url and attached_image_url.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef82e13b-61d4-46ef-8846-5c101a12c554

📥 Commits

Reviewing files that changed from the base of the PR and between 66da7b6 and 0fddf77.

📒 Files selected for processing (1)
  • api-reference/openapi.json

"/api/content/create": {
"post": {
"description": "Trigger the content creation pipeline for an artist. Provide `artist_account_id` to identify the target artist. Validates the artist has all required files (face guide, songs), then triggers a background task that generates a short-form video. Returns `runIds` \u2014 an array of run IDs that can each be polled via [GET /api/tasks/runs](/api-reference/tasks/runs). Authentication is handled via the x-api-key header.",
"description": "Trigger the content creation pipeline for an artist. Provide `artist_account_id` to identify the target artist. Validates the artist has all required files (face guide, songs) unless overridden by attached media, then triggers a background task that generates a short-form video. Returns `runIds` \u2014 an array of run IDs that can each be polled via [GET /api/tasks/runs](/api-reference/tasks/runs). Authentication is handled via the x-api-key header.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify /api/content/validate semantics after introducing override media.

Line 3788 correctly introduces conditional required-file validation, but /api/content/validate still reads as unconditional. That can cause clients to reject requests that would succeed with attached_audio_url or attached_image_url.

💡 Suggested wording update
- "description": "Check whether an artist has all the required files to run the content creation pipeline. Returns a structured report of each required and recommended file with its status. Required files must be present or the pipeline will fail. Recommended files improve output quality but are not strictly necessary. Provide `artist_account_id` as a query parameter.",
+ "description": "Check whether an artist has the required repository files to run the default content creation pipeline. Returns a structured report of each required and recommended file with its status. Note: POST /api/content/create can bypass some required repository assets when `attached_audio_url` and/or `attached_image_url` are provided. Recommended files improve output quality but are not strictly necessary. Provide `artist_account_id` as a query parameter.",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` at line 3788, Update the /api/content/validate
operation description to clarify that required-file checks (face guide, songs,
etc.) are conditional: if request includes attached_audio_url or
attached_image_url those override the need for stored artist files and will
cause the endpoint to succeed where it otherwise would fail; reference the
artist_account_id parameter and describe that the endpoint validates presence of
either the artist's stored assets or the provided attached_* URLs, and returns
validation details (errors/warnings) accordingly so clients don't reject
requests that include override media.

…places attached_image_url

Address sweetmantech's review:
- Extend songs param to accept both slugs and public URLs (no separate attached_audio_url)
- Replace attached_image_url with images array to match songs pattern (KISS)
- Add Create Content to Guides navbar above Create Sandbox

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sweetmantech sweetmantech merged commit d3de48c into main Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant